package com.apes.autoparts.product.model;

import com.apes.framework.jpa.BaseModel;
import com.apes.framework.jpa.DefaultPersistListener;
import com.apes.framework.jpa.comment.Comment;
import com.apes.framework.jpa.generator.ApesGenerator;
import com.apes.framework.util.ApesConst;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.SelectBeforeUpdate;

import javax.persistence.*;

/**
 * 类描述：蓄电池标准商品
 *
 * @ClassName AccumulatorProduct
 * @Description 描述
 * @Author lilong
 * @Date 2022/10/25 17:32
 * @Version 1.0
 */

@Getter
@Setter
@SelectBeforeUpdate
@DynamicInsert
@DynamicUpdate
@Entity
@EntityListeners(DefaultPersistListener.class)
@Table(name = AccumulatorProduct.CONST_TABLE_NAME)
public class AccumulatorProduct extends BaseModel {

    public static final String CONST_TABLE_NAME = "auto_accumulator_product";
    @Id
    @Column(name = "id", length = 10)
    @ApesGenerator(code = CONST_TABLE_NAME, name = "蓄电池标准商品")
    @Comment("编码")
    private String id;

    @Column(name = "brand", length = 24)
    @Comment("品牌")
    private String brand;

    @Column(name = "pn", length = 100)
    @Comment("零件名称")
    private String pn;

    @Column(name = "unit", length = 100)
    @Comment("单位")
    private String unit;

    @Column(name = "grade", length = 100)
    @Comment("国际标号")
    private String grade;

    @Column(name = "reference", length = 100)
    @Comment("参考号")
    private String reference;

    @Column(name = "type", length = 100)
    @Comment("类型")
    private String type;

    @Column(name = "series", length = 100)
    @Comment("系列")
    private String series;

    @Column(name = "capacity",columnDefinition = ApesConst.FIELD_MONEY_16_4_0)
    @Comment("额定容量")
    private double capacity;//(额定容量Ah)

    @Column(name = "voltage",columnDefinition = ApesConst.FIELD_MONEY_16_4_0)
    @Comment("额定电压")
    private  double voltage;//(额定电压V)

    @Column(name = "sizes", length = 100)
    @Comment("尺寸")
    private String sizes;//(*尺寸mm  长*宽*高)

    @Column(name = "terminal", length = 100)
    @Comment("端子")
    private String terminal;

    @Column(name = "electricity",length = 100)
    @Comment("冷启动电流")
    private String electricity; // (冷启动电流CCA[A])

    @Column(name = "describe", length = 100)
    @Comment("产品描述")
    private String describe;

    @Column(name = "bar_code", length = 100)
    @Comment("条形码")
    private String barCode;

    @Column(name = "ERP_product_id", length = 100)
    @Comment("ERP商品编码")
    private String ERPProductId;
}
